import postApiNew from "../../utils/http/api-new";

export default {

  //包括考试类型,考试时间,考试地点
  //4.1
  getSignInfoByExamId(examId) {
    return postApiNew({
      actionCode: "zhiye-media",
      path: "/overall/examUser/getSignInfoByExamId",
      requestData: {
        "examId": examId,
      },
    })
  },

  //传入考试类型,手机号码,验证码
  submitSign(examId, mobile, authCode) {
    return postApiNew({
      actionCode: "zhiye-media",
      path: "/overall/examUser/submitSign",
      requestData: {
        "examId": examId,
        "mobile": mobile,
        "authCode": authCode,
      },
    })
  },
  // 考试详情
  getExamDetailById(examId, subjectId,planId) {
    return postApiNew({
      actionCode: "zhiye-media",
      path: "/overall/exam/getOverallExamInfoByExamId",
      requestData: {
        "examId": examId,
        "subjectId": subjectId,
        "planId": planId,
        "isOrgLevel": 1,
      }
    })
  },
  //获取错题库
  getExamErrorById(examId, subjectId) {
    return postApiNew({
      actionCode: "zhiye-media",
      path: "/overall/exam/getErrorQuestionsByExamId",
      requestData: {
        "examId": examId,
        "subjectId": subjectId
      }
    })
  },
  // 提交考试答案
  submitExam(examId, subjectId, answers) {
    return postApiNew({
      actionCode: "zhiye-media",
      path: "/overall/data/submitExamAnswer",
      requestData: {
        "examId": examId,
        "subjectId": subjectId,
        "answers": answers
      }
    })

  },
  submitExamPlan(examId, planId, answers) {
    return postApiNew({
      actionCode: "zhiye-media",
      path: "/overall/data/submitExamAnswerForPlan",
      requestData: {
        "examId": examId,
        "planId": planId,
        "answers": answers
      }
    })

  },
  //4.9检查是否能够考试checkCanExam
  checkCanExam(subjectId, examId , planId) {
    return postApiNew({
      actionCode: 'zhiye-media',
      path: '/overall/exam/checkCanExam',
      requestData: {
        subjectId,
        examId,
        planId,
        "isOrgLevel": 1,
      }
    })
  },
  //4.8获取考试结果
  getExamResult({examResultId, errorType}) {
    return postApiNew({
      actionCode: "zhiye-media",
      path: "/overall/data/getExamResult",
      requestData: {
        examResultId,
        isErrorQuestion:errorType
      },
    })
  },
  //4.10 获取题目分析结果
  getExamAnalyzeById(examResultId) {
    return postApiNew({
      actionCode: "zhiye-media",
      path: "/overall/data/getExamResultAnalysis",
      requestData: {
        "examResultId": examResultId,
      }
    })
  },
}
